

<?php 

		//ket noi co so du lieu
	$hostName_Or_HostIP_S='localhost';
	$userName_S='picachusays';
	$password_S='qqqqqqqq';
	$dataBaseName_S='TracNghiem';
	$connect=mysqli_connect($hostName_Or_HostIP_S,$userName_S,$password_S);
	mysqli_select_db($connect,$dataBaseName_S);
	
	/*trang nay lay du lieu tu client :
	lay cac du lieu can thiet de tao*/
	$request_body = file_get_contents('php://input');//lay body request
	//bien dich sang mang
	$mang= json_decode($request_body,true);
	//for($i=0;$i<count($mang);$i++){
		$tenTaiKhoan=$mang['tenTaiKhoan'];
		$matKhau=$mang['matKhau'];
		$tenNguoiDung=$mang['tenNguoiDung'];
		$email=$mang['email'];
		$chuoiTruyVan="INSERT INTO TaiKhoan VALUES('".$tenTaiKhoan."','".$matKhau."','".$tenNguoiDung."','".$email."')";
		//cau truy van
		mysqli_query($connect,$chuoiTruyVan);
	//}
	



	//truy van them vao bang du lieu

	
	//dong ket noi
	mysqli_close($connect);
	
	$traVe['success']=true;
	echo json_encode($traVe);

?>
